package com.huike.clues.mapper;

import com.huike.clues.domain.TbClue;
import com.huike.common.annotation.AutoFill;
import com.huike.common.enums.DaoOperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * @Author: Copyright by jiyuzm
 * @Date: 2023/07/12/11:52
 * @Description: 活动相关接口-ClueMapper
 */

@Mapper
public interface TbClueMapper {
    @AutoFill(DaoOperationType.INSERT)
    int insert(TbClue clue);

    @AutoFill(DaoOperationType.UPDATE)
    int update(TbClue clue);

    int deleteById(Long id);

    int deleteByIds(List<Long> ids);

    int setTransfer(@Param("id")Long id, @Param("status") String status);

    int updateNextTimeAndStatus(@Param("clueId") Long clueId, @Param("status") String status);

    int updateClueEndTimeById(@Param("endTime") Date endTime, @Param("id") Long id);

    TbClue getById(Long id);

    TbClue getByPhone(String phone);

    List<TbClue> getClueList(TbClue clue);

    List<TbClue> getCluePool(TbClue clue);

    /**
     * 报表模块-渠道统计活动明细列表使用！！！！！请勿删除！！！！！
     * @param tbClue -
     * @return -
     */
    Map<String, Object> countByActivity(TbClue tbClue);

    /**
     * 报表模块-线索统计新增线索数量报表使用！！！！！请勿删除！！！！！
     * @param beginCreateTime/
     * @param endCreateTime/
     * @return /
     */
    List<Map<String, Object>> cluesStatistics(String beginCreateTime, String endCreateTime);

    /**
     * 线索统计明细列表
     * @param clue/
     * @return /
     */
    List<TbClue> selectTbClueForReport(TbClue clue);
}
